package com.dshome.cloudbean.uimanager;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.TextView;

import com.dshome.cloudbean.R;

/**
 * 鍔犺浇瀵硅瘽妗嗘帶浠�
 * 
 * @author RZMars
 * @date 2012-11-16
 */
public class LoadingDialog extends Dialog {

	private Context mContext;
	private LayoutInflater inflater;
	private LayoutParams lp;
	private TextView loadtext;

	public LoadingDialog(Context context) {
		super(context, R.style.Dialog);
		this.mContext = context;
		inflater = (LayoutInflater) mContext
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View layout = inflater.inflate(R.layout.weight_loadingdialog, null);
		loadtext = (TextView) layout.findViewById(R.id.loading_text);
		setContentView(layout);
		// 璁剧疆window灞炴�
		lp = getWindow().getAttributes();
		lp.gravity = Gravity.CENTER;
		lp.dimAmount = 0; // 鍘昏儗鏅伄鐩�
		lp.alpha = 1.0f;
		getWindow().setAttributes(lp);
	}

	public void setLoadText(String content) {
		loadtext.setText(content);
	}

}